<template>

	<view>
		<!-- 标题 -->
		<view class="navbar">
			<u-icon @click="navigateBack" class="icon-left" name="arrow-left" color="#333" size="50"></u-icon>
			<text>淘宝店铺</text>
		</view>
		<!-- 内容 -->
		<view class="section">
		设备链接地址：
		</view>
		<view class="binding">
			<text>{{url}}</text>
			<view style="background-color: rgb(68,92,223);color: #fff;margin-top:20rpx" @click="copeAddress"><text>一键复制地址</text></view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: 'https://m.tb.cn/h.UkhsTvC?tk=tZ0Qd4fjKXi',
				showWeb:false
			}
		},
		mounted(){
				this.showWeb = true
		},
		destroyed(){
				this.showWeb = false
		},
		methods: {
			navigateBack() {
				// wx.reLaunch({
				// 	url: '../login'
				// })
				// let pages = getCurrentPages();
				// let nowPage = pages[pages.length - 1]
				// let prevPage = pages[pages.length - 2]
				
				// uni.navigateBack({
				// 	delta:prevPage
				// })
				uni.switchTab({
					url:'../index'
				})
				
			},
		copeAddress(){
			uni.setClipboardData({
				data:this.url,
				success:function(res){
					uni.getClipboardData({
						success:function(){
							uni.showToast({
								title:'复制成功！'
							})
						}
					})
				}
			})
		}
		}
	}
</script>

<style scoped lang="scss">
	// 头部
	.navbar {
		margin-top: 90rpx;
		margin-bottom: 80rpx;
		width: 750rpx;
	}

	.navbar>text {
		font-size: 36rpx;
		font-weight: bold;
		padding-left: 220rpx;
	}

	.icon-left {
		margin-top: 20rpx;
		margin-left: 10rpx;
	}

	// 内容
	.section {
		padding: 26rpx;
		font-size: 18px;
	}

	.section>image {
		height: 150rpx;
		width: 550rpx;
	}

	// 按钮
	.binding {
		width: 750rpx;
		text-align: center;
		margin-top: 0rpx;
		padding: 10rpx 30rpx;
		padding-bottom: 340rpx;
		font-size: 36rpx;
		color: rgb(68, 92, 223);
	}

	.binding>view {
		box-shadow: 1px 1px 2px rgb(228, 227, 227), 0 0 2px rgb(228, 227, 227), 0 0 1px rgb(228, 227, 227);
		border-radius: 50rpx;
		text-align: center;
		margin-bottom: 35rpx;
		padding: 25rpx;
	}

</style>
